<?php
header("Content-Type: text/html; charset=iso-8859-1");
require_once('include.php');
$user_id = check_cookie();
$membre = (!empty($_REQUEST['membre'])) ? $_REQUEST['membre'] : "";
$contenu = (!empty($_REQUEST['contenu'])) ? $_REQUEST['contenu'] : "";
$equipe = (!empty($_REQUEST['equipe'])) ? $_REQUEST['equipe'] : "";
$email = (!empty($_REQUEST['email'])) ? $_REQUEST['email'] : "";
$email = ($email == 'false' || $email == 'FALSE') ? 0 : 1;
if($membre != $user_id || !$contenu || !$equipe) exit;
$contenu = ereg_replace("_(.*)?_","<span class = 'italic'>\\1</span>",$contenu);
$contenu = ereg_replace("\*(.*)?\*","<span class = 'bold'>\\1</span>",$contenu);
$contenu = ereg_replace("cit%(.*)?%\.(.*)?%%","<p class = 'erreur'><span class = 'bold'>\\1 a &eacute;crit : </span><br /><br />\\2</p>",$contenu);
$contenu = ereg_replace("\"(.*)?\":http://([^\ ]*)?"," <a href = 'http://\\2'>\\1</a>",$contenu);
$com = new communication();
$com->membre_id = $membre;
$com->corps = $contenu;
$com->equipe_id = $equipe;
echo ($com->add()) ? "ok" : "ko";
if($email){
	$com->email();	
} 

?>